This was already there, just had to hook it up.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
^xen/arch/powerpc/firmware$
^xen/arch/powerpc/firmware_image$
^xen/arch/powerpc/xen\.lds$
+^xen/arch/powerpc/.xen-syms$
+^xen/arch/powerpc/xen-syms.S$
^unmodified_drivers/linux-2.6/\.tmp_versions
^unmodified_drivers/linux-2.6/.*\.cmd$
^unmodified_drivers/linux-2.6/.*\.ko$
start.o: boot/start.S
$(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
-$(TARGET)-syms: start.o $(ALL_OBJS) xen.lds
- $(CC) $(CFLAGS) $(OMAGIC) -Wl,-Ttext,$(xen_link_base),-T,xen.lds start.o $(ALL_OBJS) -o $@
+TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,$(xen_link_base),-T,xen.lds
+TARGET_OPTS += start.o $(ALL_OBJS)
+
+.xen-syms: start.o $(ALL_OBJS) xen.lds
+ $(CC) $(CFLAGS) $(TARGET_OPTS) -o $@
+
+xen-syms.S: .xen-syms
+ $(CROSS_COMPILE)nm --synthetic -n $^ | $(BASEDIR)/tools/symbols > $@
+
+xen-syms.o: xen-syms.S
+ $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
+
+$(TARGET)-syms: start.o $(ALL_OBJS) xen-syms.o xen.lds
+ $(CC) $(CFLAGS) $(TARGET_OPTS) xen-syms.o -o $@
$(TARGET).bin: $(TARGET)-syms
$(CROSS_COMPILE)objcopy --output-target=binary $< $@
clean::
$(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean
- rm -f firmware firmware_image dom0.bin
+ rm -f firmware firmware_image dom0.bin .xen-syms
#include <xen/lib.h>
#include <xen/console.h>
#include <xen/sched.h>
+#include <xen/symbols.h>
+
+static char namebuf[KSYM_NAME_LEN+1];
/* Shamelessly lifted from Linux Xmon try to keep pristene */
#ifdef __powerpc64__
static void get_function_bounds(unsigned long pc, unsigned long *startp,
unsigned long *endp)
{
- *startp = pc;
- *endp = pc;
+ unsigned long size, offset;
+ const char *name;
+
+ *startp = *endp = 0;
+ if (pc == 0)
+ return;
+
+ name = symbols_lookup(pc, &size, &offset, namebuf);
+ if (name != NULL) {
+ *startp = pc - offset;
+ *endp = pc - offset + size;
+ }
}
/* Print an address in numeric and symbolic form (if possible) */
static void xmon_print_symbol(unsigned long address, const char *mid,
const char *after)
{
- char *modname;
const char *name = NULL;
unsigned long offset, size;
printf(REG, address);
-#if 0
- if (setjmp(bus_error_jmp) == 0) {
- catch_memory_errors = 1;
- sync();
- name = kallsyms_lookup(address, &size, &offset, &modname,
- tmpstr);
- sync();
- /* wait a little while to see if we get a machine check */
- __delay(200);
- }
- catch_memory_errors = 0;
-#endif
+ name = symbols_lookup(address, &size, &offset, namebuf);
if (name) {
printf("%s%s+%#lx/%#lx", mid, name, offset, size);
- if (modname)
- printf(" [%s]", modname);
}
printf("%s", after);
}
#ifndef _PPC_TYPES_H
#define _PPC_TYPES_H
-typedef unsigned short umode_t;
+#include <xen/config.h>
+#if defined(__ppc__)
+#define BYTES_PER_LONG 4
+#define BITS_PER_LONG 32
+#elif defined(__PPC64__)
+#define BYTES_PER_LONG 8
+#define BITS_PER_LONG 64
+#endif
+
+#ifndef __ASSEMBLY__
+typedef unsigned short umode_t;
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
#endif
#endif
-#include <xen/config.h>
-
typedef signed char s8;
typedef unsigned char u8;
#if defined(__ppc__)
typedef signed long long s64;
typedef unsigned long long u64;
-#define BYTES_PER_LONG 4
-#define BITS_PER_LONG 32
typedef unsigned int size_t;
#elif defined(__PPC64__)
typedef signed long s64;
typedef unsigned long u64;
-#define BYTES_PER_LONG 8
-#define BITS_PER_LONG 64
typedef unsigned long size_t;
#endif
typedef unsigned short xmem_bufctl_t;
+#endif /* __ASSEMBLY__ */
#endif